/**
 * $Id: PositionData.i,v 1.2 2009-10-12 12:46:13 ttaipalu Exp $
 *
 * \file PositionData.i
 * \brief MaCI - Python wrapper for Position interface data encoder / decoder
 * \author Antti Maula <antti.maula@tkk.fi>
 */

%{
#include "MaCIData.hpp"
#include "PositionTypes.hpp"
#include "PositionData.hpp"
#include <stdio.h>
%}

%include "../MaCIData.i"

namespace gim {
  class CBinBag;
}

namespace MaCI {
  namespace Position {
    
    /** Data Encoder/Decoder for the Position Interface.
     *
     * Contains the protocol encoder/decoder for the MaCI-Position
     * interface
     */
    class CPositionData : public MaCI::CMaCIData
    {
    public:
      CPositionData(void);
      ~CPositionData();

      /** Copy constructor for Positiondata.
       */
      CPositionData(const MaCI::Position::CPositionData &aData);


      /** Assignment operator for Positiondata.
       *
       * Use this with care; each call to this function copies data, 
       * so avoid it if possible.
       */
      CPositionData &operator=(const MaCI::Position::CPositionData &aData);
      

      /** Decode a BinBag container as PositionData element.
       *
       */
      bool DecodeFrom(gim::binbag::CBinBag *aBinBag = NULL);
      

      /** Reset decoder/Encoder.
       *
       * Resets all fields, except leaves the current BinBag container
       * pointer intact.
       */
      void Reset();
      

      /** Set timestamp element.
       *
       * Sets timestamp element for the container.
       *
       * @param[in] aStamp      Reference to element to copy inside binbag.
       * @return                'true' if the element was succesfully added 
       *                        (did not previously exists) or 'false' on error
       *                        or when the element was already set on this session.
       */
      bool SetTimestamp(const MaCI::Common::TTimestamp &aStamp);


      /** Set Pose2D element.
       *
       * Sets Pose2D element for the container.
       *
       * @param[in] aPose2D     Reference to element to copy inside binbag.
       * @return                'true' if the element was succesfully added 
       *                        (did not previously exists) or 'false' on error
       *                        or when the element was already set on this session.
       */
      bool SetPose2D(const MaCI::Position::TPose2D &aPose2D);


      /** Set Variance2D element.
       *
       * Sets variance2d element for the container.
       *
       * @param[in] aVariance2D Reference to element to copy inside binbag.
       * @return                'true' if the element was succesfully added 
       *                        (did not previously exists) or 'false' on error
       *                        or when the element was already set on this session.
       */
      bool SetVariance2D(const MaCI::Position::TVariance2D &aVariance2D);


      /** Set Probability element.
       *
       * Sets probability element for the container.
       *
       * @param[in] aProbability Reference to element to copy inside binbag.
       * @return                'true' if the element was succesfully added 
       *                        (did not previously exists) or 'false' on error
       *                        or when the element was already set on this session.
       */
      bool SetProbability(const MaCI::Position::TProbability &aProbability);


	  /** Set TPose2DReference element.
	  *
	  * Sets reference element for the container.
	  *
	  * @param[in] aRef        Reference to element to copy inside binbag.
	  * @return                'true' if the element was succesfully added 
	  *                        (did not previously exists) or 'false' on error
	  *                        or when the element was already set on this session.
	  */
      bool SetPose2DReference(const MaCI::Position::TPose2DReference &aRef);

	  /** Set Command element.
       *
       * Sets command element for the container.
       *
       * @param[in] aCommand    Reference to element to copy inside binbag.
       * @return                'true' if the element was succesfully added 
       *                        (did not previously exists) or 'false' on error
       *                        or when the element was already set on this session.
       */
      bool SetCommand(const MaCI::Position::TCommand &aCommand);
      

	  /** Set speed 2D element.
	  *
	  * Sets speed2D element for the container
	  *
	  * @param[in] aSpeed2D    Reference to element to copy inside binbag.
	  * @return                'true' if the element was succesfully added 
	  *                        (did not previously exists) or 'false' on error
	  *                        or when the element was already set on this session.
	  */
      bool SetSpeed2D(const MaCI::Position::TSpeed2D &aSpeed2D);

	  /** Return Common::TTimestamp element pointer.
       * 
       * @return                Returns pointer to element,
       *                        or NULL if no such element exists in the container.
       */
      const MaCI::Common::TTimestamp *GetTimestamp(void) const {
        return iTimestampPtr;
      }


      /** Return TPose2D element pointer.
       * 
       * @return                Returns pointer to element,
       *                        or NULL if no such element exists in the container.
       */
      const MaCI::Position::TPose2D *GetPose2D(void) const {
        return iPose2DPtr;
      }


      /** Return TVariance2D element pointer.
       * 
       * @return                Returns pointer to element,
       *                        or NULL if no such element exists in the container.
       */
      const MaCI::Position::TVariance2D *GetVariance2D(void) const {
        return iVariance2DPtr;
      }


      /** Return TProbability element pointer.
       * 
       * @return                Returns pointer to element,
       *                        or NULL if no such element exists in the container.
       */
      const MaCI::Position::TProbability *GetProbability(void) const {
        return iProbabilityPtr;
      }


      /** Return TCommand element pointer.
       * 
       * @return                Returns pointer to element,
       *                        or NULL if no such element exists in the container.
       */
      const MaCI::Position::TCommand *GetCommand(void) const {
        return iCommandPtr;
      }
	  
	  
      /** Return TPose2DReference element pointer.
       *
       * @return                Returns pointer to element,
       *                        or NULL if no such element exists in the container.
       */
      const MaCI::Position::TPose2DReference *GetPose2DReference(void) const {
        return iPose2DReferencePtr;
      }
      
      /** Return TSpeed2D element pointer.
       *
       * @return                Returns pointer to element,
       *                        or NULL if no such element exists in the container.
       */
      const MaCI::Position::TSpeed2D *GetSpeed2D(void) const {
        return iSpeed2DPtr;
      }
	  
      /** Print.
       * 
       * \copydoc CMaCIData::Print()
       */
      void Print(const int level) const;
/*
    protected:
    private:
      const Common::TTimestamp *iTimestampPtr; ///< Pointer to timestamp if exists
      const TPose2D *iPose2DPtr;
      const TVariance2D *iVariance2DPtr;
      const TProbability *iProbabilityPtr;
      const TCommand *iCommandPtr;
*/
    };
  }
}
